Add performance regresssion predictor inference feature - #6563
Open
Ali-Sayed-Salehi wants to merge 13 commits into
Open
Add performance regresssion predictor inference feature#6563Ali-Sayed-Salehi wants to merge 13 commits into
Ali-Sayed-Salehi wants to merge 13 commits into
Conversation
gmierz
reviewed
Aug 18, 2026
Uh oh! Looks like an error!InterpreterError at template.tasks["head_branch"]: object has no property "release" |
…rate file for perf predictor feature
Uh oh! Looks like an error!InterpreterError at template.tasks["head_branch"]: object has no property "release" |
1 similar comment
Uh oh! Looks like an error!InterpreterError at template.tasks["head_branch"]: object has no property "release" |
Uh oh! Looks like an error!InterpreterError at template.tasks["head_branch"]: object has no property "release" |
Uh oh! Looks like an error!InterpreterError at template.tasks["head_branch"]: object has no property "release" |
suhaibmujahid
requested changes
Sep 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bugzilla:
https://bugzilla.mozilla.org/show_bug.cgi?id=2055853
Add Performance Regression Predictor (Autoland push-based inference)
Summary
Adds an inference-only model, an HTTP service endpoint, and a CLI that predict
whether a commit is likely to introduce a performance regression. The
service takes an Autoland/try push identified by
(branch, rev)— the samecontract as the test-selection endpoint — and resolves everything server-side
from its own local Mercurial clone. Each commit in the push is scored
independently; the push-level risk is the max across commits.
Motivation
Give CI/taskgraph an early signal for pushes that are likely to regress
performance, without plumbing diffs or credentials from Phabricator. Reusing the
(branch, rev)+ local-clone approach thatschedule_testsalready uses keepsthe integration surface minimal and consistent.
How it works
The worker (
classify_perf_regression(branch, rev)) mirrorsschedule_tests:repository.pull(REPO_DIR, branch, rev)into the service's local hg clone.get_hgmo_stack(branch, rev)loads the full push stack viaautomationrelevance(withtry's draft/empty/try-config filtering).hg export --git) to get its messageand diff.
peak memory by stack size).
risk_score.The model is a HuggingFace CodeBERT sequence classifier (inference-only,
512-token window, binary). The input is the cleaned commit message plus the diff
rendered into a structured
<FILE>/<ADDED>/<REMOVED>representation matchingtraining. The
risk_scoreis the raw (uncalibrated) softmax probability of thepositive class.
API
branchis an hg.mozilla.org path (integration/autoland,try;autolandisaccepted as an alias). The first call returns
202 {"ready": false}; poll until200. A missing push returns{"available": false}.Example result:
{ "branch": "integration/autoland", "rev": "76383a875678", "risk_score": 0.75, "commits": [ {"node": "…", "prob": [0.25, 0.75], "class": 1, "risk_score": 0.75} ], "extra_data": { "model_name": "Perf Regression Predictor", "max_length": 512, "calibrated": false, "commit_count": 1 } }Also included
bugbug-predict-perf-regression) for local inference against acheckpoint + patch file, with no service/Redis/clone required.
public
artifact_url;download_modelsnow supports fetching a model from aURL instead of the Taskcluster index.
perf-regression-predictorextra(
torch==2.13.0,transformers==5.15.0, pinned to the CPU wheel index).docs/models/perf-regression-predictor.md) and theHTTP-service local-dev guide
(
http_service/README.perf-regression-predictor.md).Testing
Unit test:
cd /home/ali/repos/bugbug python -m pytest tests/test_perf_regression_predictor.py http_service/tests/test_perf_regression_predictor.pyVia docker compose: